<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>收支明细</title>
<link rel="stylesheet" type="text/css" href="/style/css/base.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/swiper.min.css"/>
<link rel="stylesheet" type="text/css" href="/style/css/xshop.css?ver=20170916" />
<link rel="stylesheet" type="text/css" href="/style/css/fu.shop.css"/>
<script src="/style/js/jquery-1.12.0.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/swiper.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/js/xShop.js" type="text/javascript" charset="utf-8"></script>
<script src="/style/dev/js/mobiscroll.core-2.5.2.js" type="text/javascript"></script>
<script src="/style/dev/js/mobiscroll.core-2.5.2-zh.js" type="text/javascript"></script>
<link href="/style/dev/css/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
<link href="/style/dev/css/mobiscroll.animation-2.5.2.css" rel="stylesheet" type="text/css" />
<script src="/style/dev/js/mobiscroll.datetime-2.5.1.js" type="text/javascript"></script>
<script src="/style/dev/js/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>
<!-- S 可根据自己喜好引入样式风格文件 -->
<script src="/style/dev/js/mobiscroll.android-ics-2.5.2.js" type="text/javascript"></script>
<link href="/style/dev/css/mobiscroll.android-ics-2.5.2.css" rel="stylesheet" type="text/css" />
<!-- E 可根据自己喜好引入样式风格文件 -->
</head>
<body>
<div class="outwrap">
  <!--top-->	
	<!-- <div class="topbar clearfix topvh">
		<a href="/myshop/my_bag" class="btn-back">
			<i class="ico-back"></i><span>提现记录</span>
		</a>
	</div> -->
  <div class="in-mian2 pt88">
    <div class="txjlbx">
      <ul id="content">
      <?php

      $jian = array(2,4,6,9);

      if ($this->data['data'])
      {
        foreach ($this->data['data'] as $v)
        {
          if(in_array($v['event'],$jian))
          {
            $jcls = ' jian';
            $jf = '- ';
          }
          else
          {
            $jcls = '';
            $jf = '';
          }
      ?>
      <li>
      <div class="info"><h2><?=$v['note']?></h2><p><?=$v['create_time']?></p></div>
      <div class="opr"><span class="money<?=$jcls;?>"><?=$jf;?><b><?=$v['cmoney']?></b></span></div>
      </li>
      <?php
        }
      }
      ?>
       </ul>
    </div>

  </div>
</div>

  <script type="text/javascript">
        $(function () {
      var currYear = (new Date()).getFullYear();  
      var opt={};
      opt.date = {preset : 'date'};
      
      opt.datetime = {preset : 'datetime'};
      opt.time = {preset : 'time'};
      opt.default = {
        theme: 'android-ics light', //皮肤样式
            display: 'modal', //显示方式 
            mode: 'scroller', //日期选择模式
        lang:'zh',
            startYear:currYear - 10, //开始年份
            endYear:currYear + 10 //结束年份
      };

        $("#startDate").scroller('destroy').scroller($.extend(opt['date'], opt['default']));
        $("#endDate").scroller('destroy').scroller($.extend(opt['date'], opt['default']));
      
        $("#search_btn").click(function(){
           location.href="/wallet/pickup_list?startDate="+$("#startDate").val()+"&endDate="+$("#endDate").val()

        });
        });
    </script>
</body>
</html>
<script>
    var _page = <?=$this->data['page'] > 0 ? $this->data['page'] : 1;?>,
        _maxpage = <?=$this->data['maxpage'] > 0 ? $this->data['maxpage'] : 1;?>,
        _loading = false;
 var jian  = ['2','4','6','9'];
    $(document).ready(function(e){

        $('.pt88').on("scroll",function(){

            if($(document).scrollTop() + $(window).height() + 200 >=$(document).height() && !_loading)
            {

                _loading = true;
                _loadMore(_page +1);
            }
        });

    });

    function _loadMore(page) {
        if (page <= _maxpage && _loading) {

            _page = page;
            $.post("/wallet/ajax", {
                "act": "getlog",
                "page": page,
                "mr": Math.random()
            }, function(json) {
                _loading = false;
                console.log(json);
                if (json.page == page && typeof json.data != "undefined" && json.data != null) {
                    $.each(json.data, function(i, v) {
                       var _html ="";
                        var u= $.inArray(v.event, jian);
                        var jcls ="";
                        var jf ="";

                        if(u !='-1'){

                            jcls = ' jian';
                            jf ="- ";
                        }

                        _html+='<li><div class="info"><h2>'+v.note+'</h2><p>'+v.create_time+'</p></div>';
                        _html+=' <div class="opr"><span class="money'+jcls+'">'+jf+'<b>'+v.cmoney+'</b></span></div></li>';
                        $("#content").append(_html);
                    });
                }
            }, "json");
        }
    }
</script>
